package com.bage.finance.biz.config;

import com.bage.finance.biz.domain.*;
import com.bage.finance.biz.domain.es.VoucherDocuemt;
import com.bage.finance.biz.dto.form.*;
import com.bage.finance.biz.dto.vo.*;
import com.bage.mybatis.help.PageInfo;
import com.bage.wx.dto.MpQrCodeCreateResult;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

@Mapper(componentModel = "spring")
public interface ObjectConvertor {

    GenerateMpRegCodeVo toGenerateMpRegCodeResponse(MpQrCodeCreateResult source);

    @Mappings({@Mapping(target = "avatar", source = "avatarUrl")})
    CurrentInfoVo toCurrentInfoVo(Member member);

    SysMenu toSysMenu(CreateMenuForm createMenuForm);

    @Mappings({@Mapping(target = "key", source = "id"), @Mapping(target = "title", source = "name")})
    ListTreeMenuVo toListTreeMenuVo(SysMenu sysMenu);

    List<ListTreeMenuVo> toListTreeMenuVo(List<SysMenu> sysMenus);

    GetMenuByIdVo toGetMenuByIdVo(SysMenu sysMenu);

    @Mappings({@Mapping(target = "value", source = "id"), @Mapping(target = "title", source = "name")})
    ListTreeSelectMenuVo toListTreeSelectMenuVo(SysMenu sysMenu);

    List<ListTreeSelectMenuVo> toListTreeSelectMenuVo(List<SysMenu> parentMenuList);

    SysResource toSysResource(CreateSysResourceForm createSysResourceForm);

    List<ListSysResourceVo> toListSysResourceVo(List<SysResource> sysResources);

    GetSysResourceVo toGetSysResourceVo(SysResource sysResource);

    PageInfo<ListRoleVo> toListRoleVoPage(PageInfo<SysRole> sysRolePageInfo);

    GetRoleDetailVo toGetRoleDetailVo(SysRole sysRole);

    MenuDataItemVo toMenuDataItemVo(SysMenu sysMenu);

    List<MenuDataItemVo> toMenuDataItemVo(List<SysMenu> childMenus);

    @Mappings({
            @Mapping(target = "valueAddedTaxCate", expression = "java(com.bage.finance.biz.enums.ValueAddedTaxCateEnum.getMessage(accountBook.getValueAddedTaxCate()))"),
            @Mapping(target = "accountingStandard", expression = "java(com.bage.finance.biz.enums.AccountingStandardEnum.getMessage(accountBook.getAccountingStandard()))")
    })
    ListAccountBookVo toListAccountBookVo(AccountBook accountBook);

    PageInfo<ListAccountBookVo> toListAccountBookVoPage(PageInfo<AccountBook> accountBookPageInfo);

    AccountBook toAccountBook(AddAccountBookForm request);

    GetAccountBookVo toGetAccountBookVo(AccountBook accountBook);

    List<DataDictionaryVo> toDataDictionaryVo(List<DataDictionary> data);

    List<ListCurrencyConfigVo> toListCurrencyConfigVo(List<CurrencyConfig> currencyConfigs);

    GetCurrencyConfigVo toGetCurrencyConfigVo(CurrencyConfig currencyConfig);

    CurrencyConfig toCurrencyConfig(CreateCurrencyConfigForm form);

    VoucherWordConfig toVoucherWordConfig(CreateVoucherWordConfigForm form);

    List<ListVoucherWordConfigVo> toListVoucherWordConfigVo(List<VoucherWordConfig> voucherWordConfigs);

    GetVoucherWordConfigVo toGetVoucherWordConfigVo(VoucherWordConfig voucherWordConfig);

    AssistCalculateCate toAssistCalculateCate(CreateAssistCalculateCateForm form);

    List<ListCalculateCateVo> toListCalculateCateVos(List<AssistCalculateCate> assistCalculateCateList);

    GetAssistCalculateCateVo toGetAssistCalculateCateVo(AssistCalculateCate assistCalculateCate);

    AssistCalculateSummary toAssistCalculateSummary(CreateAssistCalculateForm form);

    AssistCalculateCustom toAssistCalculateCustom(CreateAssistCalculateCustomForm form);

    List<ListAssistCalculateCustomVo> toListAssistCalculateVo(List<AssistCalculateCustom> assistCalculateCustoms);

    GetAssistCalculateCustomVo toGetAssistCalculateCustomVo(AssistCalculateCustom assistCalculateCustom);

    AssistCalculateCustomer toAssistCalculateCustomer(CreateAssistCalculateCustomerForm form);

    List<ListAssistCalculateCustomerVo> toListAssistCalculateCustomerVo(List<AssistCalculateCustomer> assistCalculateCustomers);

    GetAssistCalculateCustomerVo toGetAssistCalculateCustomerVo(AssistCalculateCustomer assistCalculateCustomer);

    AssistCalculateDepartment toAssistCalculateDepartment(CreateAssistCalculateDepartmentForm form);

    List<ListAssistCalculateDepartmentVo> toAssistCalculateDepartmentVo(List<AssistCalculateDepartment> assistCalculateDepartments);

    GetAssistCalculateDepartmentVo toGetAssistCalculateDepartmentVo(AssistCalculateDepartment assistCalculateDepartment);

    AssistCalculateEmployee toAssistCalculateEmployee(CreateAssistCalculateEmployeeForm form);

    List<ListAssistCalculateEmployeeVo> toAssistCalculateEmployee(List<AssistCalculateEmployee> source);

    GetAssistCalculateEmployeeVo toGetAssistCalculateEmployeeVo(AssistCalculateEmployee assistCalculateEmployee);

    AssistCalculateInventory toAssistCalculateInventory(CreateAssistCalculateInventoryForm form);

    List<ListAssistCalculateInventoryVo> toListAssistCalculateInventoryVo(List<AssistCalculateInventory> assistCalculateInventories);

    GetAssistCalculateInventoryVo toGetAssistCalculateInventoryVo(AssistCalculateInventory assistCalculateInventory);

    AssistCalculateProject toAssistCalculateProject(CreateAssistCalculateProjectForm form);

    List<ListAssistCalculateProjectVo> toListAssistCalculateProjectVo(List<AssistCalculateProject> assistCalculateProjects);

    GetAssistCalculateProjectVo toGetAssistCalculateProjectVo(AssistCalculateProject assistCalculateProject);

    AssistCalculateSupplier toAssistCalculateSupplier(CreateAssistCalculateSupplierForm form);

    List<ListAssistCalculateSupplierVo> toListAssistCalculateSupplierVo(List<AssistCalculateSupplier> assistCalculateSuppliers);

    GetAssistCalculateSupplierVo toGetAssistCalculateSupplierVo(AssistCalculateSupplier assistCalculateSupplier);

    List<ListAssistCalculateCashFlowVo> toListAssistCalculateCashFlowVo(List<AssistCalculateCashFlow> assistCalculateCashFlows);

    ListSubjectVo toListSubjectVo(Subject subject);

    Subject toSubject(CreateSubjectForm form);

    SubjectCalculateConfigForm.NumberCalculateConfig toNumberCalculateConfig(SubjectCalculateConfigVo.NumberCalculateConfig numberCalculateConfig);

    List<SubjectCalculateConfigForm.AssistCalculateConfig> toAssistCalculateConfig(List<SubjectCalculateConfigVo.AssistCalculateConfig> assistCalculateConfigs);

    GetSubjectVo toGetSubjectVo(Subject subject);

    DownloadSubjectVo toDownloadSubjectVo(Subject subject);

    PageInfo<ListVoucherVo> toListVoucherVo(PageInfo<VoucherDocuemt> esData);

    List<ListSubjectByCateAndCodeAndNameVo> toListSubjectByCateAndCodeAndNameVo(List<Subject> subjects);

    List<ListMemberVo> toListMemberVo(List<Member> members);

    GetSubjectDetailVo toGetSubjectDetailVo(Subject subject);

    List<GetSubjectDetailVo.ForeignCurrencyConfigVo> toForeignCurrencyConfigVo(List<CurrencyConfig> currencyConfigs);

    List<GetSubjectDetailVo.AssistCalculateConfigVo> toAssistCalculateConfigVo(List<AssistCalculateCate> assistCalculateCates);

    Voucher toVoucher(CreateVoucherForm form);

    List<VoucherSubjectDetail> toVoucherSubjectDetail(List<CreateVoucherForm.VoucherSubjectDetailForm> voucherSubjectDetailFormList);

    List<VoucherSubjectAssistCalculateDetail> toVoucherSubjectAssistCalculateDetail(List<CreateVoucherForm.VoucherSubjectAssistCalculateDetailForm> voucherSubjectAssistCalculateDetailFormList);

    GetVoucherVo toGetVoucherVo(Voucher voucher);

    List<GetVoucherVo.VoucherSubjectDetailVo> toGetVoucherSubjectDetailVo(List<VoucherSubjectDetail> voucherSubjectDetails);

    List<GetVoucherVo.ForeignCurrencyConfigVo> toForeignCurrencyConfigVo2(List<CurrencyConfig> currencyConfigs);

    VoucherDocuemt toVoucherES(Voucher voucher);

    List<VoucherDocuemt.SubjectDocument> toSubjectES(List<VoucherSubjectDetail> voucherSubjectDetailList);

    List<VoucherDocuemt.AssistCalculateDocument> toAssistCalculateES(List<VoucherSubjectAssistCalculateDetail> temp);

    List<ListFolderVo> toListFolderVo(List<Folder> list);

    Folder toFolder(CreateFolderForm form);

    GetFolderVo toGetFolderVo(Folder folder);

    ListFileVo toListFileVo(File file);

    PageInfo<ListAssistCalculateSummaryVo> toListAssistCalculateSummaryVo(PageInfo<AssistCalculateSummary> assistCalculates);
}
